﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Collections.ObjectModel;

namespace VideoRentalShop.Model
{
    public class Order
    {
        private static readonly DateTime MIN_DATE = new DateTime(1950, 1, 1);


        public Order()
        {
            OrderDetails = new ObservableCollection<OrderDetails>();
            MakeDate = MIN_DATE;
        }


        [Required]
        public long Id { get; set; }

        [Required]
        public long ClientId { get; set; }
        public virtual Client Client { get; set; }

        [Required]
        public DateTime MakeDate { get; set; }
        
        [Required]
        public bool Archived { get; set; }

        public virtual ObservableCollection<OrderDetails> OrderDetails { get; private set; }
    }
}
